home *** CD-ROM | disk | FTP | other *** search
Wrap
/* REXX script to install Iris buttons */ /* Creates hard link to selected button directory */ /* Jilles Tjoelker, 14-Mar-1998 */ options failat 20 options results currentdir='' /* change here, for example 'AmiTCP:Iris/' */ if ~exists(currentdir||'Storage') then do address command 'requestfile >t:f "" title "Select Iris drawer" drawersonly' if rc>0 then do address command 'delete >nil: t:f' end else nop open(1,'t:f','read') currentdir=readln(1) close(1) currentdir=strip(currentdir,'b','"') address command 'delete >nil: t:f' end else nop pragma('d',currentdir) if ~exists('Storage') then do address command 'requestchoice >nil: "Install-Buttons" "The *"Storage*" directory doesn''t exist:*Nwrong selection or wrong installation." "Abort"' exit end parse arg buttons if buttons="" then do buttons="Storage/" address command 'requestfile >t:f "Storage/" title "Select button set" drawersonly' if rc>0 then do address command 'delete >nil: t:f' exit end else nop end else nop open(1,'t:f','read') buttons=readln(1) close(1) address command 'delete >nil: t:f' if substr(buttons,length(buttons)-1,1)=':' then do address command 'requestchoice >nil: "Install-Buttons" "You can''t select the root directory." "Abort"' exit end address command 'delete >nil: Buttons'||'0a'x||'setenv tmpioerr $result2' res1=rc open(1,'env:tmpioerr','read') ioerr=readln(1) close(1) address command 'delete >nil: env:tempioerr' if res1>0 then do select when ioerr=205 then nop when ioerr=216 then do address command 'rename Buttons Storage/Old_Buttons' address command 'rename Buttons.info Storage/Old_Buttons.info' if rc>0 then do address command 'requestchoice >nil: "Install-Buttons" "The directory *"Storage*" does not exist.*NThis is caused by a wrong installation." "Abort"' exit end else nop end otherwise address command 'requestchoice >nil: "Install-Buttons" "AmigaDOS error' ioerr '*N(`fault' ioerr '`)" "Abort"' exit end end else address command 'delete >nil: Buttons.info' options failat 1 address command 'makelink hard force Buttons '||buttons buttons=substr(buttons,1,length(buttons)-2)||'.info"' address command 'makelink hard force Buttons.info '||buttons options failat 20 if show('p','IRIS') then do address 'IRIS' 'ASKCHOICE "Install-Buttons" "The buttons have been installed.*NIt is necessary to restart Iris*Nto use the new buttons.*NDo you wish me to do this?" *_Yes|_No' if rc=0 then do 'GETFOLDER' curfol=result q=0 do while rc=0 'FOLDERNAME' q if result=curfol then leave q=q+1 end xrc=rc 'QUIT' do while show('p','IRIS') address command 'wait 1' end if xrc=0 then do address command 'run >nil: <nil: iris curfol' q end else do address command 'run >nil: <nil: iris' end end else nop end else, address command 'requestchoice >nil: "Install-Buttons" "The buttons have been installed." "OK"'